<!DOCTYPE html>
<?php
session_start();
if (isset($_SESSION['admin'])) {
    require_once("viewmenu.php");
?>
<html lang="pt-br">
    <head>
        <meta charset="utf-8"/>
        <link rel="stylesheet" type="text/css" href="css/estilo-default.css"/>
        <link rel="stylesheet" type="text/css" href="css/tabelavendas.css"/>       
        <link rel="stylesheet" type="text/css" href="css/jquery-ui.css"/>
        <script type="text/javascript" src="js/jquery.js"></script>
        <script type="text/javascript" src="js/jquery-ui.js"></script>
        <script type="text/javascript" src="js/jquery.validate.js"></script>
        <script type="text/javascript" src="js/util.validate.js"></script>
        <script type="text/javascript" src="js/venda.cadastro.js"></script>    
        <script type='text/javascript' src='js/jquery.form.js'></script>     
        <title>Cadastro</title>
    </head>
    <body>
        <div id='centro'>
            <p>Cadastrar Vendas</p>
            <form name="venda" id="venda" method="post" action="../control/ControleCadastroVendas.php">
                <fieldset>
                <table>
                    <tr>
                        <th id="cartao">Cartão</th>
                        <th id="cli">Nome do Cliente</th>
                    </tr>
                    <tr>
                        <td><input type="text" name="cpf" class="input-text" maxlength="11" id="cpfnum" autofocus></td>
                        <td><input type="text" name="cliente" class="input-text" maxlength="50" id="cliente" readonly/></td>
                    </tr>
                </table>
                <table  id="itemsTable">
                <thead>
                    <tr>
                        <th id="cod">Código</th>
                        <th id="nome">Nome</th>
                        <th id="qtd">Qtd</th>
                        <th id="valor">Valor Unit</th>
                        <th id="del"></th>                        
                    </tr>
               </thead>
               <tbody id="body">
                    <tr class="item-row">
                        <td><input name="codpro[]" id="codpro"  class="codpro" maxlength="13"/> </td>
                        <td><input name="nome[]" id="nomepro"  class="nome" maxlength="50" readonly/></td>
                        <td><input name="qtd[]"  id="qtde"  class="input-text" maxlength="3" readonly/></td>
                        <td><input name="preco[]" id="preco"  class="input-text" maxlength="6" readonly/> </td>
                        <td class="delete"><a id="deleteRow"><img src="imagens/icon-minus.png" alt="Remove Item" title="Remove Item"></a></td>                        
                   </tr>
              </tbody>
              </table>
                <button id="addRow"><span> <img src="imagens/icon-plus.png" alt="Add" title="Add Row" /> Novo Item</span></button>
                <input type="submit" name="controle" value="Finalizar Venda"/>
                <button type="button" id="voltar" name='voltar' value='voltar'>Voltar</button>
            </fieldset>
            </form>            
        </div>
    </body>
</html>
    <?php
} else {
    header("Location: index.php");
}
?>